#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
//#include "../../Common/include/com_memory.h"
#include "com_memory.h"

int main()
{
	char *p = (char*)zoo::common::memory::Alloc(128);

	int nRet = 0;
	int fd = 0;
	fd = open("/dev/defender_sqlxss", O_RDWR);

	printf("open device [/dev/defender_sqlxss] : %d \n", fd);

	if (fd < 0)
	{
		printf("open device error \n");
	}
	else
	{
		printf("open device success\n");

		nRet = read(fd, p, 128);
		printf("read  = %s\n", p);
		nRet = write(fd, "1234", 5);
		printf("write = \n");

		close(fd);
	}

	zoo::common::memory::Free(p);

	return 0;
}
